<template>
    <div id="detail">
        <div class="detail-con">
            <p>名称：{{detail.expressName}}</p>
            <p>简介：{{detail.expressJianjie}}</p>
            <p>理念：{{detail.expressJyln}}</p>
            <p>特色：{{detail.expressTeshe}}</p>
        </div>
        <div class="detail-info" v-html="detail.expressDetail">
            {{detail.expressDetail}}
        </div>
    </div>
</template>

<script>
import qs from 'qs'
import router from './../../../router'
import store from '@/store/index.js'
import global from '@/lib/global'
export default {
    data(){
        return {
            detail: ''
        }
    },
    created(){
      // 获取快递公司详情
      this.getData(global.baseUrl + '/open/companyDetail?id='+ this.$route.query.id,'','get',(resp)=>{
          if(resp.data.success){
              this.detail = resp.data.data;
              console.log(this.detail)
          }else{
              this.$message.error(resp.data.message);
          }
      })
    },
    methods: {
      getData(url,data,type,fn){
          this.$axios({
              headers: {
                  'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8',
                  'token':sessionStorage.getItem('token')
              },
              method: type,
              url: url,
              data: qs.stringify(data)
          }).then((resp)=>{
              if(fn){
                  fn(resp);
              }else{
                  console.log(resp);
              }
          })
          .catch((error)=>{
              console.log(error);
              this.$message.error('网络出错了');
          })
      },
    }
}
</script>

<style>
    #detail{
        width: 1280px;
        margin: 0 auto;
    }
    .detail-con{
        text-align: left;
    }
</style>